package org.nobody.mallb2c.mallcart.config;

import org.nobody.mallb2c.mallcart.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 3489309323@qq.com
 * @create 2020-09-16-19:32
 */
@Configuration
public class MallWebConfig implements WebMvcConfigurer {
  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**"/*←拦截发向本服务的所有请求*/);
  }
}
